<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>
        <ui:composition template="/publico/template.xhtml">
            <ui:define name="content">
                <p:messages />
                <h:form id="fprincipal" >
                    <p:panel header="Secagem">
                        <h:panelGrid columns="2">
                            <h:outputLabel 
                                id="olLote"
                                for="itLote" 
                                value="Lote: "/>
                            <h:inputText 
                                id="itLote"
                                readonly="true"
                                value="#{processoBean.processo.id}"/>

                            <h:outputLabel 
                                id="olsecagem"
                                for="sosecagem" 
                                value="Local: "/>
                            <h:selectOneMenu 
                                id="sosecagem" 
                                value="#{processoBean.secagem.localSecagem}"
                                converter="LocalConversor">
                                <f:selectItems value="#{localBean.locais}"
                                               var="l"
                                               itemLabel="#{l.nome}"
                                               itemValue="#{l}"/>
                            </h:selectOneMenu>

                            <h:outputLabel 
                                for="itmassaseca" 
                                value="Massa Seca: "/>
                            <p:inputText 
                                id="itmassaseca" 
                                value="#{processoBean.secagem.massaSeca}"/>

                            <h:outputLabel 
                                id="oldatainicio"
                                for="cdatainicio" 
                                value="Data do inicio: *"/>
                            <p:calendar 
                                id="cdatainicio" 
                                value="#{processoBean.secagem.inicioDaSecagem}"
                                navigator="true"/>

                            <h:outputLabel 
                                id="oldatafim"
                                for="cdatafim" 
                                value="Data do fim: *"/>
                            <p:calendar 
                                id="cdatafim" 
                                value="#{processoBean.secagem.fimDaSecagem}"
                                navigator="true"/>

                            <h:outputLabel 
                                for="ittemperatura" 
                                value="Temperatura: "/>
                            <p:inputText 
                                id="ittemperatura" 
                                value="#{processoBean.secagem.temperatura}"/>
                        </h:panelGrid>

                        <p:commandButton 
                            id="cbsalvar"
                            ajax="false" 
                            value="Salvar"
                            action="#{processoBean.salvarSecagem()}" />

                        <p:button
                            id="cbcancelar"
                            value="Cancelar"
                            outcome="/restrito/lote/informacao-lote.xhtml"/>
                    </p:panel>
                </h:form>
            </ui:define>
        </ui:composition>
    </body>
</html>
